<!--
 * @description  : 市管-信息维护-从业人员、仓储信息等列表展示组件
 * @descriptionDetail: 市管-信息维护-从业人员、仓储信息等列表展示组件
 * @copyright    : 浙江烟草
 * @author       : sy
 * @create       : 2022-07-26 18:43:02
-->
<template>
  <view>
    <u-row gutter="16" v-for="(pItem, pIdx) in lists" :key="pIdx">
      <u-col span="9">
        <slot :data="pItem" :index="pIdx"></slot>
      </u-col>
      <u-col span="3" style="text-align:center;display:flex;">
        <u-icon
          name="edit-pen"
          :color="$theme.u_type_primary"
          size="32"
          style="flex: 1;"
          v-if="!isDisabled && isEdit"
          @tap="handlerEdit(pItem)"
        ></u-icon>
        <u-icon
          name="trash"
          color="red"
          size="32"
          style="margin-left: 5px;flex: 1;" 
          v-if="!isDisabled"
          @tap="handlerDel(pItem)"
        ></u-icon>
      </u-col>
    </u-row>
  </view>
</template>
<script>
export default {
  props: {
    lists: {
      type: Array,
      default: () => [],
    },
    recordItemUuid: {
      type: String,
      default: "",
    },
    isDisabled: {
      type: Boolean,
      default: false,
    },
    isEdit:{
      type: Boolean,
      default: true,
    },
    isDel:{
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {
    }
  },
  methods: {
    // 编辑
    handlerEdit(item) {
      this.$emit("edit", {item: item, recordUuid: this.recordItemUuid,});
    },
    // 删除
    handlerDel(item) {
      this.$emit("del", {item: item, recordUuid: this.recordItemUuid,});
    },
  },
  
}
</script>
<style lang="scss" scoped>
.title {
  font-size: 15px;
  color: #666;
  font-weight: 600;
  margin: 5px 10px;
}
.sub-title {
  color: #666;
  margin: 3px 10px;
}
</style>